package main

import "fmt"

func main() {

	var nilPointer *int
	fmt.Println(nilPointer)
	// <nil>

	if nilPointer == nil {
		fmt.Println("nil pointer")
	} else {
		fmt.Println(*nilPointer)
	}
	// nil pointer

	nilPointer = new(int)
	fmt.Println(*nilPointer)
	// 0

	numPtr := new(int)
	fmt.Println(numPtr)
	// 0xc00000a0c8

	fmt.Println(*new(string))    // 空字符串
	fmt.Println(*new(int))       // 0
	fmt.Println(*new([5]int))    // [0 0 0 0 0]
	fmt.Println(*new([]float64)) // []
}
